home *** CD-ROM | disk | FTP | other *** search
- Path: gryphon.phoenix.net!usenet
- From: brucew@phoenix.net (Bruce Wedding)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with stringcopy
- Date: Thu, 11 Jan 1996 01:51:28 GMT
- Organization: BranPaul Systems
- Message-ID: <4d1o41$sec@gryphon.phoenix.net>
- References: <4clguu$9fs@eagle.novo.dk> <yewvimppjz5.fsf@hyll.idt.unit.no> <4cmafq$bm5@clarknet.clark.net> <4cmi91$irn@newshost.lanl.gov>
- NNTP-Posting-Host: dial18.phoenix.net
- X-Newsreader: Moe's Newsreader
-
- tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:
-
- >|> >char *Stringcopy(char *source, int startpos, size_t length)
- >|> >{
- >|> > char tmpstring[SIZEBIGENOUGH];
- >|> > strncpy((char *)(source+startpos),tmpstring,length);
- >|> > return tmpstring;
- >|> >}
- >|>
- >but, most importantly,
- >this routine contains one of the very common and absolutely disastrous
- >beginner errors! Anyone?
-
- Returning a pointer to an automatic. What do I win :)
-
-
- Bruce D. Wedding Have Compiler, Will Travel!
- Perspicacious Programming Performed Promptly
- Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
-
-